import java.lang.reflect.Array;
import java.util.Arrays;

/**
 * Version: 1.1
 * Author: TangJun
 * Date: 2024-07-11
 */
public class Main {
//    public static void printInt(int x){
//        if (x == 0){
//            return;
//        }
//        printInt(x / 10);
//        System.out.printf("%d ", x%10);
//    }
//    public static int  sum(int x){
//        if (x < 10){
//            return x;
//        }
//        return x%10 + sum(x/10);
//    }

//    public static int sum(int x){
//        if (x == 1){
//            return x;
//        }
//        return x + sum(x-1);
//    }

    public static void hanio(int n, char p1, char p2, char p3){
        if (n == 1){
            System.out.print(p1 + "->" + p3 + " ");
            return;
        }
        hanio(n-1, p1, p3, p2);
        hanio(1, p1, p2, p3);
        hanio(n-1, p2, p1, p3);
    }
    public static void main1(String[] args) {
        hanio(3, 'A', 'B', 'C');
    }

    public static void main2(String[] args) {
        int[] arr1 = {1,2,3};
        int[] arr2 = new int[]{1,2,3,4};
        int[] arr3 = new int[10];
        char[] arr4 = new char[10];
        boolean[] arr5 = new boolean[10];
        System.out.println("hello");
        for(int x : arr1){
            System.out.print(x + " ");
        }
        System.out.println();
        String str = Arrays.toString(arr2);
        System.out.println(str);
    }

    public static void main3(String[] args) {
        int[] arr = new int[100];
        for (int i = 0; i < 100; i++) {
            arr[i] = i+1;
        }

        int count = 0;
        for (int x : arr) {
            if (count >= 10){
                System.out.println();
                count = 0;
            }
            System.out.print(x + " ");
            count++;
        }
    }
    public static String myToString(int[] array){
        String ret = "";
        for (int i = 0; i < array.length; i++) {
            ret = ret + array[i];
            if (i != array.length-1){
                ret += ", ";
            }
        }
        ret = "[" + ret + "]";
        return ret;
    }

    public static void main(String[] args) {
        int[] array = new int[]{1,2,3,4,5};
        System.out.println(myToString(array));
        System.out.println(Arrays.toString(array));
    }
}
